<?php

namespace App\Models;

class Regions extends Base
{
    protected $table = 'regions';

    protected $fillable = [
        'id','name','pid','sort','deep','region','created_at','updated_at'
    ];
    /**
     * 获取级联列表
     * @return mixed
     */
    protected function getCascaderList(){
        $lists = $this->get(['id as value','name as label','pid'])->toArray();
        return $this->listToTree($lists, 'value');
    }
}
